#include "Indices.h"

using namespace Core;


Core::IndicesBase::IndicesBase(IndicesType type) :_type(type)
{

}

Core::IndicesType Core::IndicesBase::GetDatatype()
{
	return _type;
}

Core::IndicesUnsignedInt::IndicesUnsignedInt() :IndicesBase(IndicesType::UnsignedInt)
{
	_values = new std::vector<unsigned int>();
}

Core::IndicesUnsignedInt::~IndicesUnsignedInt()
{

}

std::vector<unsigned int>* Core::IndicesUnsignedInt::GetValues()
{
	return _values;
}

void Core::IndicesUnsignedInt::AddTriangle(TriangleIndicesUnsignedInt& triangle)
{
	_values->push_back(triangle.GetUI0());
	_values->push_back(triangle.GetUI1());
	_values->push_back(triangle.GetUI2());
}

Core::IndicesUnsignedShort::IndicesUnsignedShort() :IndicesBase(IndicesType::UnsignedShort)
{
	_values = new std::vector<unsigned short>();
}

Core::IndicesUnsignedShort::IndicesUnsignedShort(int capacity) : IndicesBase(IndicesType::UnsignedShort)
{
	_values = new std::vector<unsigned short>(capacity);
}

std::vector<unsigned short>* Core::IndicesUnsignedShort::GetValues()
{
	return _values;
}

void Core::IndicesUnsignedShort::AddTriangle(TriangleIndicesUnsignedShort& triangle)
{
	_values->push_back(triangle.GetUI0());
	_values->push_back(triangle.GetUI1());
	_values->push_back(triangle.GetUI2());
}
